﻿namespace Sample.JwtBearer.Api.Settings;


/// <summary>
/// 跨域策略配置
/// </summary>
public class CorsSetting
{
    /// <summary>
    /// 策略名称
    /// </summary>
    public string Name { get; set; } = string.Empty;

    /// <summary>
    /// 跨域策略配置
    /// </summary>
    public CorsPolicyConfig CorsPolicy { get; set; } = new();
}

/// <summary>
/// 跨域策略配置
/// </summary>
public class CorsPolicyConfig
{
    /// <summary>
    /// 域名白名单
    /// </summary>
    public string[] WithOrigins { get; set; } = Array.Empty<string>();

    /// <summary>
    /// 允许的http请求谓词
    /// </summary>
    public string[] WithMethods { get; set; } = Array.Empty<string>();

}